<?php
require_once 'Response.php';

final class XWriter {
	
	/**
	 * 单体类实例
	 *
	 * @var XWriter
	 */
	private static $_instance = null;
	
	/**
	 * 应用程序的根目录
	 *
	 * @var string
	 */
	private $_appRoot;
	
	/**
	 * XML输出源
	 *
	 * @var Response
	 */
	private $_response;
	
	public static function instance() {
		if(self::$_instance == null) {
			self::$_instance = new XWriter();
		}
		return self::$_instance;
	}
	
	private function __construct() {
		$this->_appRoot = $this->pathFormat(substr(dirname(__FILE__), 0, -8));
	}
	
	public function run() {
		
	}
	
	public function pathFormat($str) {
		$str = trim(str_replace("\\", '/', $str));
		return rtrim($str, '/');
	}
	
	public function getResponse() {
		return $this->_response;
	}
}

?>
